package com.wc.AlgoOJ._BFS.扩散;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/4/3 14:33
 * @description http://43.138.190.70:8888/p/LQ1137T
 */
public class Main {
    static int N = 2600;
    static int[][] g = new int[N][N];
    // 标记扩散点
    static int X;
    //    static int[][] q = new int[N * N][2];
    static int[] dx = new int[]{-1, 1, 0, 0};
    static int[] dy = new int[]{0, 0, -1, 1};
    static int hh = 1, tt = 0;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        X = sc.nextInt();
        bfs();
        int res = 0;
        for (int i = 1; i < N; i++) {
            for (int j = 1; j < N; j++) {
                if (g[i][j] > 0) res++;
            }
        }
        System.out.println(res);
    }

    static void bfs() {
        g[0 + 1010][0 + 1010] = 1;
        g[520 + 1010][11 + 1010] = 1;
        g[11 + 1010][14 + 1010] = 1;
        g[214 + 1010][521 + 1010] = 1;
        Queue<Integer> q = new LinkedList<>();
        q.add(1010);
        q.add(1010);
        q.add(11 + 1010);
        q.add(14 + 1010);
        q.add(520 + 1010);
        q.add(11 + 1010);
        q.add(214 + 1010);
        q.add(521 + 1010);
        int x, y;
        while (!q.isEmpty()) {
            x = q.poll();
            y = q.poll();
            if (g[x][y] <= X) {
                for (int i = 0; i < 4; i++) {
                    int nx = x + dx[i];
                    int ny = y + dy[i];
                    if (g[nx][ny] != 0) continue;
                    q.add(nx);
                    q.add(ny);
                    g[nx][ny] = g[x][y] + 1;
                }
            }
        }
    }
}